package tongcheng.com.tongcheng.widght;


import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import tongcheng.com.tongcheng.R;


/**
 * @author youj
 * 自定义dialog
 */
public class DismissDialog extends Dialog {


    private TextView mDialog_dis_dismiss;
    private TextView mDialog_dis_ok;
    private EditText mDialog_dis_et;
    private final View mView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(mView);

        setCanceledOnTouchOutside(true);
    }

    private void initView() {
        mDialog_dis_dismiss = mView.findViewById(R.id.dialog_dis_dismiss);
        mDialog_dis_ok = mView.findViewById(R.id.dialog_dis_ok);
        mDialog_dis_et = mView.findViewById(R.id.dialog_dis_et);
    }
    //取消按钮
    public DismissDialog setdismiss(View.OnClickListener listener) {
        mDialog_dis_dismiss.setOnClickListener(listener);
        return this;
    }

    //确定按钮
    public DismissDialog setOk(View.OnClickListener listener) {
        mDialog_dis_ok.setOnClickListener(listener);
        return this;
    }
    //获取取消订单内容
    public String getBody() {
        return mDialog_dis_et.getText().toString().trim();
    }

    public DismissDialog(Context context) {
        super(context, R.style.ProgressDialog);
        mView = View.inflate(context, R.layout.dismiss_dialog_view, null);
        initView();

    }







}
